Platform Explorer / Nuxeo Platform 2021.62

Operation Document.Update (Update Properties)

Description

Set multiple properties on the input document. The properties are specified as key=value pairs separated by a new line. The key used for a property is the property xpath. To specify multi-line values you can use a \ character followed by a new line.

Example:

dc:title=The Document Title
dc:description=foo bar
For updating a date, you will need to expose the value as ISO 8601 format, for instance :

Example:

dc:title=The Document Title
dc:issued=@{org.nuxeo.ecm.core.schema.utils.DateParser.formatW3CDateTime(CurrentDate.date)}

Returns back the updated document.

To update a multi-valued field with multiple values:

custom:multivalued=a,b,c,d

Save parameter automatically saves the document in the database. It has to be turned off when this operation is used in the context of the empty document created, about to create, before document modification, document modified events.

Operation id Document.Update
Category Document
Label Update Properties
Requires
Since

Parameters

Name Description Type Required Default value
properties properties yes  
changeToken string no  
propertiesBehaviors properties no  
save boolean no true 

Signature

Inputs document, documents
Outputs document, documents

Implementation Information

Implementation Class Class: org.nuxeo.ecm.automation.core.operations.document.UpdateDocument
Contributing Component org.nuxeo.ecm.core.automation.coreContrib

JSON Definition

{
  "id" : "Document.Update",
  "label" : "Update Properties",
  "category" : "Document",
  "requires" : null,
  "description" : "Set multiple properties on the input document. The properties are specified as <i>key=value</i> pairs separated by a new line. The key used for a property is the property xpath. To specify multi-line values you can use a \\ character followed by a new line. <p>Example:<pre>dc:title=The Document Title<br>dc:description=foo bar</pre>For updating a date, you will need to expose the value as ISO 8601 format, for instance : <p>Example:<pre>dc:title=The Document Title<br>dc:issued=@{org.nuxeo.ecm.core.schema.utils.DateParser.formatW3CDateTime(CurrentDate.date)}</pre><p>Returns back the updated document.<p>To update a multi-valued field with multiple values:<pre>custom:multivalued=a,b,c,d</pre><p>Save parameter automatically saves the document in the database. It has to be turned off when this operation is used in the context of the empty document created, about to create, before document modification, document modified events.</p>",
  "url" : "Document.Update",
  "signature" : [ "document", "document", "documents", "documents" ],
  "params" : [ {
    "name" : "properties",
    "description" : null,
    "type" : "properties",
    "required" : true,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "changeToken",
    "description" : null,
    "type" : "string",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "propertiesBehaviors",
    "description" : null,
    "type" : "properties",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "save",
    "description" : null,
    "type" : "boolean",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ "true" ]
  } ]
}